package com.test;


class T extends Thread {
    int ticket=25;
    public void run() {
        while (this.ticket >= 0) {
            System.out.println( Thread.currentThread()+"买100张的第" + ticket--+"张");
            //System.out.println("线程运行");

        }
    }
}


public class demo3 {
    public static void main(String[] args) {
        T threadTicket = new T();
        new Thread(threadTicket, "窗口1").start();
        new Thread(threadTicket, "窗口2").start();
        new Thread(threadTicket, "窗口3").start();
        new Thread(threadTicket, "窗口4").start();
    }

}